import 'package:flutter/material.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/config/router_config.dart';
import 'package:s_mankey/generated/I18n.dart';
import 'package:s_mankey/provider/provider_widget.dart';
import 'package:s_mankey/ui/widget/home_car_widget.dart';
import 'package:s_mankey/ui/widget/show_toast.dart';
import 'package:s_mankey/view_model/home_vmodel.dart';

class HotShared extends StatelessWidget {

  final datas;

  HotShared({this.datas});

  @override
  Widget build(BuildContext context) {
    return  Stack(
        children: <Widget>[
          HomeCardWidget(
              child: Column(
                children: <Widget>[
                  Container(
                    color: Color(0xFFffecec),
                    height: 30,
                    alignment: Alignment.center,
                    child: Text(
                      I18n.current.shareArticle,
                      style: TextStyle(fontSize: AppFontSize.Size16, color: Color(0xffee5f90)),
                    ),
                  ),
                  GestureDetector(
                    onTap: () {
//                      String url = 'https://3w.huanqiu.com/a/564394/9CaKrnKnKTV?agt=8';
//                      Toast.toast(context,msg: "功能暂未开放 ");
                    },
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        Padding(
                          padding: EdgeInsets.all(AppPadding.Padding10),
                          child: ClipRRect(
                            borderRadius: BorderRadius.all(
                                Radius.circular(AppPadding.Padding10)),
                            child:
                            Image.network(
                              datas['image_url'],
                              fit: BoxFit.fill,
                              width: 78,
                              height: 81,
                            ),
                          ),
                        ),
                        Expanded(
                          child: Container(
                            padding: EdgeInsets.fromLTRB(0, 5, 10, 10),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                Text(
                                  datas['title'],
                                  style: TextStyle(fontSize: AppFontSize.Size14, color: Color(0xff2b2b2b)),
                                ),
                                Text(
                                  datas['description'],
                                  style: TextStyle(
                                      fontSize: AppFontSize.Size14, color: Color(0xff747474)),
                                ),
                                Row(
                                  mainAxisAlignment:
                                  MainAxisAlignment.spaceBetween,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: <Widget>[
                                    Text(
                                      (datas['read_count']).toString(),
                                      style: TextStyle(
                                          fontSize: AppFontSize.Size14, color: Color(0xffa5a5a5)),
                                    ),
                                    GestureDetector(
                                        onTap: () {
                                          print('点击跳到历史文章');
                                        },
                                        child: Text(
                                          '${I18n.current.historyArticle}>>',
                                          style: TextStyle(fontSize: AppFontSize.Size14, color: Color(0xff6b6b6b)),
                                        ))
                                  ],
                                )
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              )),
        ],
      );



  }
}
